//
//  WPSecondView.m
//  wobingwoyi
//
//  Created by WGP on 16/7/26.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "WPSecondView.h"
#import "WPSecondViewOfBtnView.h"

@interface WPSecondView ()

@property(nonatomic,strong)WPSecondViewOfBtnView *firstView;
@property(nonatomic,strong)WPSecondViewOfBtnView *secondView;
@property(nonatomic,strong)UIView *lineView;

@end
@implementation WPSecondView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
        
    }
    return self;
}

-(void)setupUI
{
    self.backgroundColor = [UIColor whiteColor];
    
    self.firstView = [[WPSecondViewOfBtnView alloc] initWith:@"shangzaishuju" title:@"上载病历" introduceStr:@"更方便的病例存储" clickBlock:^{
        
        [self.delegate WPSecondViewOfFirstSubviewDelegate:self];
        
    }];
    [self addSubview:self.firstView];
    
    self.lineView = [UIView new];
    self.lineView.backgroundColor = HomeLineColor;
    [self addSubview:self.lineView];
    
    self.secondView = [[WPSecondViewOfBtnView alloc] initWith:@"jiaoliushequ" title:@"交流社区" introduceStr:@"更好的交流方式" clickBlock:^{
        
        [self.delegate WPSecondViewOfSecondSubviewDelegate:self];
        
    }];
    [self addSubview:self.secondView];
    
    [self.firstView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.equalTo(self);
        make.width.mas_equalTo(SCREEN_WIDTH*0.5);
    }];
    
    [self.secondView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(SCREEN_WIDTH*0.5);
        make.right.top.bottom.equalTo(self);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(0.5);
        make.center.equalTo(self);
        make.top.equalTo(self).offset(5);
        make.bottom.equalTo(self).offset(-5);
    }];
}

@end
